package com.zsc.wxm.ysh.anjo.result;

import lombok.Getter;
import lombok.ToString;

/**
 * @author playmaker
 * @since 2021-01-19
 */
@Getter
@ToString
public enum CodeEnum {
    /**
     * 返回状态码
     */
    SUCCESS(20000, true, "成功"),
    ERROR(5000, false, "错误"),
    UNKNOWN_ERROR(20001, false, "未知错误"),
    FILE_UPLOAD_ERROR(30001, false, "文件上传失败"),
    FILE_REMOVE_ERROR(30002, false, "文件删除失败"),
    SEND_SMS_ERROR(40000, false, "短信发生失败"),
    SMS_SEND_ERROR_BUSINESS_LIMIT_CONTROL(40001, false, "短信发送过于频繁"),
    PHONE_FORMAT_ERROR(50000, false, "手机号格式不正确"),
    PHOME_IS_EXIT(50001, false, "手机号已存在"),
    USER_IS_NOT_EXIT(6000, false, "用户不存在"),
    VIOLATION_ERROR(70000, false, "数据校验异常"),
    SEND_EMAIL_ERROR(80000, false, "发送邮件失败"),
    EMAIL_IS_NOT_EXIT(80001, false, "邮箱不存在"),
    BASE_DATA_IS_EXIT(90000, false, "基础数据已存在"),
    BASE_DATA_SORT_IS_EXIT(90001, false, "基础数据的排序序号已存在"),
    TIME_COVER_ERROR(90002,false, "时间格式转换出错"),
    TOKEN_IS_NOT_EXIT(90003, false, "token不存在"),
    HOUSE_IS_EXIT(100000, false, "房源已存在"),
    HOUSE_IS_UNAVAILABLE(100001, false, "该房源已出租"),
    REQUEST_IS_EXIT(100002, false, "您已提交过预约请求"),
    VALID_EXCEPTION(100001, false, "参数校验异常"),

    ;

    /**
     * 状态码
     */
    private Integer code;

    /**
     * 是否成功
     */
    private Boolean success;

    /**
     * 返回信息
     */
    private String message;

    /**
     * 构造
     * @param code 状态码
     * @param success 是否成功
     * @param message 返回信息
     */
    private CodeEnum(Integer code, Boolean success, String message) {
        this.code = code;
        this.success = success;
        this.message = message;
    }
}
